package SqList;

import LinkList.Item;

public class Manager {
    public static void main(String[] args){
        //按降幂实例化三个顺序表
        List list1 = new List();
        List list2 = new List();
        List list3 = new List();

        list1.addAt(0, new Item(1, 5));
        list1.addAt(1, new Item(2, 3));
        list1.addAt(2, new Item(1, 1));

        list2.addAt(0, new Item(1, 5));
        list2.addAt(1, new Item(2, 4));
        list2.addAt(2, new Item(3, 3));
        list2.addAt(3, new Item(3, 2));

        list3 = list3.mergeChain(list1, list2);

        System.out.println("顺序表实现一元多项式相加的过程: ");
        list1.listAll();
        System.out.print(" + ");
        list2.listAll();
        System.out.print(" = ");
        list3.listAll();
    }
}
